package pers.ree.demo.designpattern.memento;

import java.io.Serializable;

/**
 * 备忘录对象
 * 用于保存Originator对象的信息
 */
public class Memento implements Serializable {

    private int code;

    private String name;


    public Memento(Originator originator) {
        this.code = originator.getCode();
        this.name = originator.getName();
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
